package com.xx.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.Date;

@Data
public class BaseEntity {
//    @TableId(type = IdType.AUTO)
//    private Integer id;
    /**
     * 创建时间
     */
    @TableField(value = "created_at",fill = FieldFill.INSERT)
    private LocalDateTime createdAt;

    /**
     * 修改时间
     */
    @TableField(value = "updated_at",fill = FieldFill.UPDATE)
    private LocalDateTime updatedAt;

    /**
     * 删除时间
     */
    @TableField(value = "deleted_at",fill = FieldFill.DEFAULT )
    private LocalDateTime deletedAt;

    /**
     * 版本
     */
    @Version
    @TableField(value = "version",fill = FieldFill.INSERT_UPDATE)
    private Integer version;
}